Skip to content

Conversation

@jay-sahnan
Copy link
Contributor

Add ESLint and Ruff for TypeScript and Python linting

This PR adds linting and formatting tools to maintain code quality across the templates repository.

Changes

TypeScript/JavaScript:
Added ESLint with TypeScript support
Configured with Prettier integration (no conflicts)
Set unused variables to warnings (lenient for template/example code)
Added scripts: pnpm lint and pnpm lint:fix

Python:
Added Ruff for Python linting (via uvx)
Configured with lenient rules for template/example code
Auto-fixed 287 linting issues (whitespace, imports, type annotations)
Added scripts: pnpm lint:python, pnpm lint:python:fix, pnpm format:python
Formatted all Python files (16 files)

Configuration

ESLint: Warns on unused vars (allows _ prefix), works with Prettier
Ruff: Ignores strict naming conventions (N815, N806) for template code
Both tools configured to be lenient for example/template code

Copy link
Contributor

@shrey150 shrey150 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving, would address nits before merging!

5) Add required API keys/IDs to .env
6) python main.py

1. python -m venv venv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use this opportunity to use uv venv instead? (as well as in all other READMEs?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

2. source venv/bin/activate # On Windows: venv\Scripts\activate
3. uvx install stagehand python-dotenv pydantic
4. cp .env.example .env
5. Add required API keys/IDs to .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, #5 should probably be a comment

🎮 Browserbase: https://www.browserbase.com
💡 Try it out: https://www.browserbase.com/playground
🔧 Templates: https://www.browserbase.com/templates
📧 Need help? [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind tagging the Discord here? http://stagehand.dev/discord

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah

Comment on lines 30 to 31
5. Add your Browserbase API key, Project ID, and Google Generative AI API key to .env
6. Edit COMPANY_NAMES array in main.py to specify which companies to process
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be comments too -- just like above feedback

@jay-sahnan jay-sahnan merged commit 409a909 into dev Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants